package com.mm.base.forest;

import com.dtflys.forest.annotation.Request;

/**
 * 描述: http框架 forest 请求网页
 *
 * @author: yanglin
 * @Date: 2021-06-07-11:39
 * @Version: 1.0
 */
public interface OtherClient {

    /**
     * 京东网页
     * @return
     */
    @Request(
            url = "https://search.jd.com/Search?keyword=java&enc=utf-8&wq=java&pvid=d1c3531b41f34647a448f397b1376e6d",
            headers = "Accept: text/plain"
    )
    String queryJdGoods();

    /**
     * 免费天气API获取
     * https://www.sojson.com/blog/305.html
     * @return
     */
    @Request(
            url = "http://t.weather.itboy.net/api/weather/city/${0}",
            headers = "Accept: text/plain"
    )
    String queryWeatherDay(Integer cityCode);


    /**
     * 获取当天周几信息
     * https://api.7585.net.cn/week/api.php?date=2021-03-31
     * @param dateStr
     * @return
     */
    @Request(
            url = "https://api.7585.net.cn/week/api.php?date=${0}",
            headers = "Accept: text/plain"
    )
    String queryWeekInfo(String dateStr);


    /**
     * 获取节假日信息
     * http://timor.tech/api/holiday/
     * @param dateStr
     * @return
     */
    @Request(
            url = "http://timor.tech/api/holiday/info/${0}"
    )
    String queryWorkInfo(String dateStr);

    /**
     * ------------------------------------------------------------------------------
     * 聚合数据免费接口
     *
     * https://www.juhe.cn/docs/o1
     * ------------------------------------------------------------------------------
     */

    /**
     * 聚合-获取节假日信息
     * https://www.juhe.cn/docs/api/id/606
     * @param dateStr
     * @return
     */
    @Request(
            url = "http://apis.juhe.cn/fapig/calendar/day.php?date=${0}&detail=1&key=c1e63f84b38a47659b5e8ec007f558e5"
    )
    String queryWorkInfoTwo(String dateStr);


    /**
     * 按更新时间查询笑话
     * https://www.juhe.cn/docs/api/id/95
     *
     * @param time
     * @return
     */
    @Request(
            url = "http://v.juhe.cn/joke/content/list.php?page=${0}&pagesize=10&sort=desc&time=${1}&key=d511bcf50f1f1c93e298fd78c19aaf46"
    )
    String queryJestList(Integer page, Long time);


    /**
     * 新闻列表查询
     * https://www.juhe.cn/docs/api/id/235
     *
     * @param type top(推荐,默认)guonei(国内)guoji(国际)yule(娱乐)tiyu(体育)junshi(军事)keji(科技)caijing(财经)youxi(游戏)qiche(汽车)jiankang(健康)
     * @return
     */
    @Request(
            url = "http://v.juhe.cn/toutiao/index?type=${0}&page_size=10&is_filter=1&key=64150afd825a279eea2f328b1c96c71a"
    )
    String queryNewsList(String type);

    /**
     * 每日简报
     *
     * https://www.juhe.cn/docs/api/id/742
     *
     * @return
     */
    @Request(
            url = "http://apis.juhe.cn/fapigx/bulletin/query?key=c17d1a26a8d56472fc643d3a685ea48b"
    )
    String queryTodayNewsList();
}
